package com.iteaj.iboot.plugin.crawler.sites;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

@Data
public class ResolverParam {

    /**
     * 爬取的站点id
     */
    private String alias;

    /**
     * 数据地址
     */
    private String url;

    /**
     * 数据内容
     */
    private JSONObject content;

    private ResolverParam() {}

    public static ResolverParam build(JSONObject data) {
        ResolverParam param = new ResolverParam();
        param.setUrl(data.getString("url"));
        param.setAlias(data.getString("alias"));
        param.setContent(data.getJSONObject("content"));
        return param;
    }
}
